package org.jeecg.common.nc.enums;


import java.util.HashMap;
import java.util.Map;

/**
 * webservice枚举
 */
public enum WSEnum {
    /**
     * 发送给NC
     */
    GONGYINGSHANG("recSupplier", "供应商", "string2", "last_sync_of_", ""),
    CAIGOUDAN("recPoOrder", "采购单", "string2", "last_sync_of_", ""),
    CAIGOUFAPIAO("recPoInvoices", "采购发票", "string2", "last_sync_of_", ""),
    TRAVElEXPENSEBX("travelExpenseBX", "差旅费报销", "string1", "last_sync_of_", ""),
    COMMUNICATIONEXPENSEBX("communicationExpenseBX", "通讯费报销", "string1", "last_sync_of_", ""),
    CASHPAYMENTBILL("cashPaymentBill", "资金付款审批单", "string1", "last_sync_of_", ""),
    BORROWMONEYBILL("borrowMoneyBill", "借款单", "string1", "last_sync_of_", ""),
    SERVEEXPENSEBX("serveExpenseBX", "招待费报销", "string1", "last_sync_of_", ""),
    REPAYMENTBILL("repaymentBill", "还款单", "string1", "last_sync_of_", ""),

    /**
     * 从NC同步
     */
    ZUZHI("findOrgsByGroup", "组织", "string1", "last_sync_of_", ""),
    GONGYINGSHANGDOC("findSupplierByOrg", "供应商", "string2", "last_sync_of_", ""),
    SHANGPINFENLEI("findMarbasclassByOrg", "商品分类", "string2", "last_sync_of_", ""),
    SHANGPINDANWEI("findMeasdocByOrg", "计量单位", "string2", "last_sync_of_", ""),
    USER("findUsersByOrg", "用户", "string2", "last_sync_of_", ""),
    DEPT("findDeptByOrg", "部门", "string2", "last_sync_of_", ""),
    SHANGPIN("findMaterialByOrg", "商品", "string2", "last_sync_of_", ""),
    PERSONNEL("findPsndocsAndJobByOrg", "人员", "string2", "last_sync_of_", ""),
    INOUTBASICCLASS("findInoutBusicClassByOrg", "收支项目", "string2", "last_sync_of_", ""),
    INOUTUSE("findInoutUseByOrg", "收支项目使用权", "string2", "last_sync_of_", ""),
    TAXCODE("findTaxrateByTS", "税率", "string2", "last_sync_of_", ""),
    SUPFINANCE("findBdSupfinanceByOrg","供应商财务信息","string2", "last_sync_of_", ""),
    SUPPLIER("findSupplierByOrg","供应商基本信息","string2", "last_sync_of_", "");


    private static final Map<String, WSEnum> interToEnum = new HashMap<String, WSEnum>();

    static {
        for (WSEnum type : WSEnum.values()) {
            interToEnum.put(type.getCode(), type);
        }
    }

    private String code;//编号
    private String name;//名称
    private String tsname;//ts字段名称
    private String rediskey;//ts键值
    private String msg;//预留msg





    WSEnum(String code, String name, String tsname, String rediskey, String msg) {
        this.code = code;
        this.msg = msg;
        this.name = name;
        this.tsname = tsname;
        this.rediskey = rediskey;
    }



    public static WSEnum fromInteger(int code) {
        return interToEnum.get(code);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTsname() {
        return tsname;
    }

    public void setTsname(String tsname) {
        this.tsname = tsname;
    }

    public String getRediskey() {
        return rediskey + code;
    }

    public void setRediskey(String rediskey) {
        this.rediskey = rediskey;
    }
}

